package org.com.action.user;


import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;
import org.com.dao.RegistDao;
import org.com.domain.User;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings("serial")
public class MyInfoAction extends ActionSupport implements Preparable, ModelDriven<User>, SessionAware {

	User user;
	RegistDao dao;
	String str;
	Map<String, Object> session;
	
	public User getUser() {
		
		return user;
	}
	
	@Override
	public String execute() throws Exception {
	
		return SUCCESS;
	}
	
	public void prepare() throws Exception {
		user = new User();
		dao = new RegistDao();
		
		User obj = (User) session.get("my_info");
		str = obj.getName();
		user = dao.getUser(str);
			
	}

	public void setSession(Map<String, Object> session) {
		this.session = session;
		
	}

	public User getModel() {
		// TODO Auto-generated method stub
		return user;
	}

	
	
}
